import sympy

prime_start = 2
poss = {}
while prime_start < 1000000:
    prime = prime_start
    res = prime
    count = 1
    while True:
        prime = sympy.nextprime(prime)
        res += prime
        if res > 1000000:
            break
        count += 1
        if sympy.isprime(res):
            if str(res) in poss.keys():
                if count > poss[str(res)]:   # 有可能一个素数有两种加和方式
                    poss[str(res)] = count
            else:
                poss[str(res)] = count
    prime_start = sympy.nextprime(prime_start)
print(sorted(poss.items(), key=lambda x: x[1], reverse=True)[:3])
